<?php

require_once 'Zend/View/Helper/Abstract.php';

/**
 * CleanUri helper
 *
 * @author      Forrest Lyman
 * @copyright   Copyright (c) 2007 - 2010,  Core Media USA (core-media.com)
 * @license     http://core-media.com/license/new-bsd     New BSD License
 * @version     Release: @package_version@
 * @link        http://www.corecms.com
 * @since       Release 1.5.0
 */
class Core_View_Helper_General_CleanUri extends Zend_View_Helper_Abstract
{
    /**
     * removes any params from the uri
     */
    public function CleanUri($uri = null, $absolute = false, $stripUnderscores = false)
    {
        if ($uri == null) {
           $uri = $this->view->pageObj->getCleanUri();
        }
        if ($absolute && !empty($uri)) {
            $uri = '/' . $uri;
        }
        if ($stripUnderscores) {
            $uri = Core_Toolbox_String::stripUnderscores($uri, true);
        }
        return  Core_Toolbox_String::addHyphens($uri);
    }
}